<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";
import { onMounted, ref } from "vue";
//
const modal = ref();
//
const isOpen = (b: boolean) => {
  if (b) {
    modal.value.open();
  } else {
    modal.value.close();
  }
};
//
onLoad(() => {
  // if 内容判断是否打开
  setTimeout(() => {
    isOpen(true);
  }, 500);
});
//
const confirm = () => {
  modal.value.close();
  uni.navigateTo({
    url: "/pages/lawer/lawer?id=" + 8,
  });
};

onMounted(() => {});
</script>

<template>
  <view class="ConsultationPop">
    <uv-modal
      class="modal"
      :closeOnClickOverlay="false"
      :showConfirmButton="false"
      ref="modal"
    >
      <view class="slot-content">
        <!-- <view class="title font14333">
          <image
            src="https://lehuopai-1311286543.cos.ap-guangzhou.myqcloud.com/img/shop_user.png"
            class="avatar"
          />
          <view>您好，我是智能AI导购妍馨~</view>
        </view>
        <view class="content font14666">
          <view class="content_item">亲亲是要购买产品吗？</view>
          <view class="content_item">可成为合伙人线上卖情趣用品哦</view>
          <view class="content_item">快快加盟开线下情趣体验馆吧</view>
        </view>
        <view class="btn">
          <uv-button
            customStyle="border-radius: 10px;"
            type="primary"
            color="#495BFF"
            @click="confirm"
            text="立即咨询"
          ></uv-button>
        </view> -->
        <view class="click_bt" @click="confirm"></view>
      </view>
      <image
        src="https://wealth-1311286543.cos.ap-guangzhou.myqcloud.com/taoshe/static/icon_close.png"
        class="icon_close"
        @click="() => modal.close()"
      />
    </uv-modal>
  </view>
</template>

<style lang="scss" scoped>
.icon_close {
  position: absolute;
  bottom: -74px;
  left: 50%;
  transform: translate(-50%);
  margin: auto;
  height: 34px;
  width: 34px;
}
.click_bt {
  height: 40px;
  width: 250px;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%);
}
.slot-content {
  background-image: url("https://lehuopai-1311286543.cos.ap-guangzhou.myqcloud.com/img/pop.png");
  width: 100%;
  height: 400px;
  background-size: 100% 100%;
  // .btn {
  //   padding-top: 25rpx;
  // }

  // .title {
  //   display: flex;
  //   align-items: center;
  //   padding-bottom: 25rpx;
  //   .avatar {
  //     height: 24px;
  //     width: 24px;
  //     margin-right: 10px;
  //   }
  // }
  // .content {
  //   .content_item {
  //     border-radius: 10px;
  //     background: #fff;
  //     padding: 10px;
  //     margin: 10px 0;
  //   }
  // }
}
</style>
